public bool SaveDataRow(DataRow ObjDataRow, string TableName, string SchemaName = "", bool IsDelete = false, List<string> CustomKeys = null) { Connection_Wcf Cn = this.GetConnection(); Do_Constants.Str_Request_Save Rs = new Do_Constants.Str_Request_Save(); Rs.TableName = TableName; Rs.SchemaName = SchemaName; Rs.IsDelete = IsDelete; Rs.CustomKeys = CustomKeys; Rs.ConnectionString = Cn.pConnectionString; SimpleDataRow Sdr = new SimpleDataRow(ObjDataRow); Rs.Serialized_ObjectDataRow = Sdr.Serialize(); Do_Constants.Str_Request_Session Rss = new Do_Constants.Str_Request_Session(); Rss.SessionID = ClsDataAccess_Wcf_Session.Instance.pSessionID; Client_WcfService Client = Client_WcfService.CreateObject(); String ResponseData = Client.SaveDataRow(Rss, Rs); Do_Constants.Str_Response_Save Rps = Do_Methods.DeserializeObject_Json<Do_Constants.Str_Response_Save>(ResponseData); Boolean SaveResult = Rps.SaveResult; DataRow Dr_Response = Rps.Sdr.ToDataRow(); foreach (DataColumn Dc in ObjDataRow.Table.Columns) { ObjDataRow[Dc.ColumnName] = Dr_Response[Dc.ColumnName]; } return SaveResult; }
public String Load_RowDetails(Do_Constants.Str_Request_Session Request_Session, Do_Constants.Str_Request_Load Request_Load) { SimpleDataRow Rv = new SimpleDataRow(); Interface_DataAccess Da = Do_Methods.CreateDataAccess(); try { if (Do_Methods.Convert_String(Request_Load.ConnectionString) == "") { Da.Connect(); } else { Da.Connect(Request_Load.ConnectionString); } DataRow Dr = Da.Load_RowDetails(Request_Load.ObjectName, Request_Load.Key, Request_Load.Condition, Request_Load.ForeignKeys); SimpleDataTable Sdt = new SimpleDataTable(Dr.Table.Clone()); Rv = Sdt.NewRow(Dr); } catch (Exception Ex) { this.ErrorHandler(Ex, "WcfService.Method: Load_RowDetails"); } finally { Da.Close(); } return Rv.Serialize(); }