how to edit the attachment file in ASP.net MVC4 -
i have created list of project in crud operation, in have created list of projects uploading attachment. problem when update project list. unable read inserted file , unable upload attachment file.
businees access layer code is
public bool updateproject(projectinfomodel upd) { try { int projectid = upd.projectid; string projectcode = upd.projectcode; string projectname = upd.projectname; int projecttechnologiesid = upd.projecttechnologiesid; int projectengagementmodelid = upd.projectengagementmodelid; int clientid = upd.clientid; datetime projectstartdate = upd.projectstartdate; datetime projectenddate = upd.projectenddate; string remarks = upd.remarks; datetime createddatetime = upd.createddatetime; int createdby = upd.createdby; int lastmodifiedby = upd.lastmodifiedby; datetime lastmodifieddatetime = upd.lastmodifieddatetime; string projectstatus = upd.projectstatus; int projectleadid = upd.projectleadid; int accountmanagerid = upd.accountmanagerid; // below code stored procedure db.projectupdate(projectid, projectcode, projectname, projecttechnologiesid, projectengagementmodelid, clientid, projectstartdate, projectenddate, remarks, createddatetime, createdby, lastmodifiedby, lastmodifieddatetime, projectstatus, projectleadid, accountmanagerid); } catch (exception e) { } return true; }
controller code is
public actionresult updateproject(string id) { projectinfomodel pm = new projectinfomodel(); try { pm = objpmsbal.getproject(convert.toint32(id)); viewbag.clientid = new selectlist(objpmsbal.listclientid(), "clientid", "clientid"); viewbag.projectengagementmodelid = new selectlist(objpmsbal.listengagementid(), "projectengagementmodelid", "projectengagementmodelid"); viewbag.resourceid = new selectlist(objpmsbal.listresourceid(), "resourceid", "resourceid"); viewbag.technologyid = new selectlist(objpmsbal.listtechnologyid(), "projecttechid", "projecttechid"); } catch (exception e) { } return view(pm); } [httppost] public actionresult updateproject(projectinfomodel up) { if (modelstate.isvalid) { objpmsbal.updateproject(up); // calling bal method } return redirecttoaction("projectlist1"); }
so need solve problem. thank in advance.
Comments
Post a Comment