public void Create(TrackJob element)
        {
            using (var client = new STMTrackJobServiceClient())
            {
                string startDate  = element.StartDate.ToShortDateString();
                string finishDate = element.FinishDate.ToShortDateString();
                string createDate = element.CreateDate.ToShortDateString();

                AxdEntity_STMTrackJobTable entity = new AxdEntity_STMTrackJobTable();
                entity._DocumentHash  = entity._DocumentHash;
                entity.RecId          = Convert.ToInt64(element.RecId);
                entity.RecIdSpecified = true;
                entity.RefTrackId     = element.RefTrackId;
                entity.Name           = element.Name;
                entity.ProjId         = element.ProjId;
                entity.ProjStage      = element.Stage;
                entity.STMMBU         = (AxdEnum_STMMBU)Enum.Parse(typeof(AxdEnum_STMMBU), element.BU);
                entity.StmTrackId     = element.TrackId;
                entity.STMTypeRoom    = (AxdEnum_STMTypeRoomJIS)Enum.Parse(typeof(AxdEnum_STMTypeRoomJIS), element.TypeRoom);
                entity.ProjAmount     = Convert.ToDecimal(element.ProjAmount);
                entity.STMTrackStatus = (AxdEnum_STMTrackStatus)Enum.Parse(typeof(AxdEnum_STMTrackStatus), element.TrackStatus);
                if (startDate != "01/01/1900" && startDate != "01/01/0544")//(soDaily.DueDate != DateTime.MinValue)
                {
                    entity.StartDate = DateTime.ParseExact(startDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
                }
                if (finishDate != "01/01/1900" && finishDate != "01/01/0544")//(soDaily.DueDate != DateTime.MinValue)
                {
                    entity.FinishDate = DateTime.ParseExact(finishDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
                }
                if (createDate != "01/01/1900" && createDate != "01/01/0544")//(soDaily.DueDate != DateTime.MinValue)
                {
                    entity.CreatedDate = DateTime.ParseExact(createDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
                }

                var trackJob = new AxdSTMTrackJob()
                {
                    STMTrackJobTable = new AxdEntity_STMTrackJobTable[1] {
                        entity
                    }
                };

                client.ClientCredentials.Windows.ClientCredential.Domain   = UserAccount.Domain;
                client.ClientCredentials.Windows.ClientCredential.UserName = UserAccount.Username;
                client.ClientCredentials.Windows.ClientCredential.Password = UserAccount.Password;
                client.create(CallContexts.get(), trackJob);
            }
        }
        public void Edit(TrackJob element)
        {
            AxdSTMTrackJob trackJob = new AxdSTMTrackJob();

            using (var client = new STMTrackJobServiceClient())
            {
                client.ClientCredentials.Windows.ClientCredential.Domain   = UserAccount.Domain;
                client.ClientCredentials.Windows.ClientCredential.UserName = UserAccount.Username;
                client.ClientCredentials.Windows.ClientCredential.Password = UserAccount.Password;
                trackJob = client.read(CallContexts.get(), Client.read(element.RecId));
            }

            using (var client = new STMTrackJobServiceClient())
            {
                AxdEntity_STMTrackJobTable entity = trackJob.STMTrackJobTable[0];
                var trackJobQry = new AxdSTMTrackJob()
                {
                    ClearNilFieldsOnUpdate          = trackJob.ClearNilFieldsOnUpdate,
                    ClearNilFieldsOnUpdateSpecified = true,
                    DocPurpose          = trackJob.DocPurpose,
                    DocPurposeSpecified = true,
                    SenderId            = trackJob.SenderId
                };

                string startDate  = element.StartDate.ToShortDateString();
                string finishDate = element.FinishDate.ToShortDateString();
                string createDate = element.CreateDate.ToShortDateString();

                AxdEntity_STMTrackJobTable entityUpdate = new AxdEntity_STMTrackJobTable();
                entityUpdate._DocumentHash  = entity._DocumentHash;
                entityUpdate.RecId          = Convert.ToInt64(element.RecId);
                entityUpdate.RecIdSpecified = true;
                entityUpdate.RefTrackId     = "";
                entityUpdate.Name           = element.Name;
                entityUpdate.ProjId         = element.ProjId;
                entityUpdate.ProjStage      = element.Stage;
                entityUpdate.STMMBU         = (AxdEnum_STMMBU)Enum.Parse(typeof(AxdEnum_STMMBU), element.BU);
                entityUpdate.StmTrackId     = element.TrackId;
                entityUpdate.STMTypeRoom    = (AxdEnum_STMTypeRoomJIS)Enum.Parse(typeof(AxdEnum_STMTypeRoomJIS), element.TypeRoom);
                entityUpdate.ProjAmount     = Convert.ToDecimal(element.ProjAmount);
                entityUpdate.STMTrackStatus = (AxdEnum_STMTrackStatus)Enum.Parse(typeof(AxdEnum_STMTrackStatus), element.TrackStatus);
                if (startDate != "01/01/1900" && startDate != "01/01/0544")//(soDaily.DueDate != DateTime.MinValue)
                {
                    entityUpdate.StartDate = DateTime.ParseExact(startDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
                }
                if (finishDate != "01/01/1900" && finishDate != "01/01/0544")//(soDaily.DueDate != DateTime.MinValue)
                {
                    entityUpdate.FinishDate = DateTime.ParseExact(finishDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
                }
                if (createDate != "01/01/1900" && createDate != "01/01/0544")//(soDaily.DueDate != DateTime.MinValue)
                {
                    entityUpdate.CreatedDate = DateTime.ParseExact(createDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
                }

                trackJobQry.STMTrackJobTable = new AxdEntity_STMTrackJobTable[1] {
                    entityUpdate
                };

                client.ClientCredentials.Windows.ClientCredential.Domain   = UserAccount.Domain;
                client.ClientCredentials.Windows.ClientCredential.UserName = UserAccount.Username;
                client.ClientCredentials.Windows.ClientCredential.Password = UserAccount.Password;
                client.update(CallContexts.get(), Client.read(element.RecId), trackJobQry);
            }
        }