I have a function named InserUpdateRecords(int flag) to which I pass integer variable which indicates the type of operation it has to perform , if flag==1 then insert , if flag==2 then update. Here is my code:public void InsertUpdateRecords(int flag){    Data_Customer_Log customer_log=new Data_Customer_Log();    try    {        if(flag==2)        {            customer_log = (from cust in dt.Data_Customer_Logs                            where cust.cApplicationNo == Request.QueryString[ApplicationNO]                            select cust).SingleOrDefault();          }        customer_log.cCustomerType = NewCustomerddlCustomerType.Text;        customer_log.cBranchName = NewCustomerddlBranchName.Text;        customer_log.nBranchNo = Convert.ToDecimal(Global.gBranchNo);                     .                     .                     .                     .    }    catch{}}So when I create Data_Customer_Log customer_log=new Data_Customer_Log();and then depending on the value of flag I use it , is it an appropriate approach, what are the possible downsides to my approach.
Inserting and updating record using LINQ by calling a common function
c#;linq